package io.renren.modules.xm.service.impl;

import io.renren.modules.xm.entity.CustomerEntity;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.xm.dao.AccPayDetailDao;
import io.renren.modules.xm.entity.AccPayDetailEntity;
import io.renren.modules.xm.service.AccPayDetailService;

import javax.annotation.Resource;


@Service("accPayDetailService")
public class AccPayDetailServiceImpl extends ServiceImpl<AccPayDetailDao, AccPayDetailEntity> implements AccPayDetailService {

    @Resource
    AccPayDetailDao accPayDetailDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        int current =  Integer.parseInt((String)params.get("page"));
        int limit =  Integer.parseInt((String)params.get("limit"));
        params.put("page",(current-1)*limit);
        params.put("limit",limit);

        int total = accPayDetailDao.count(params);
        Page<AccPayDetailEntity> page = new Page<>(current,limit);
        List<AccPayDetailEntity> list = accPayDetailDao.queryPage(params);
        page.setRecords(list);
        page.setTotal(total);

        return new PageUtils(page);
    }

}
